      subroutine systempsmovie(nx,nz,delta,f1,f2,&
	      & ft,dtsnaps,title,label1,label2,wbox,d1num,d2num, &
	      &  ideltasnap, ntsnaps,filename1  )

      implicit none
      integer ::  i,j,it,kw
      double precision:: t
      complex*16, parameter :: imag=(0.,1.0)
!       complex*16 ::Ptaux

      integer::ntsnaps,ideltaSnap,kss,ks

      integer ::nx, nz
      character*10 filename1


      character*20 :: title,label1,label2
      double precision :: wbox,hbox,lx,f1,f2,ft
      double precision :: delta,dtsnaps,d1num,d2num
      character*1, parameter:: apos=achar(39)! apostrophe
      character*5 :: chn1,chn2,chn3
      character*10 :: chdelta,chd3,chd1num,chd2num,chwbox,chhbox,chlx,chf1,chf2,chf3


      write(*,*)
      write(*,*)
!       write(*,*)'*******************************  PSIMOVIE  ************************************'


      if(nz.lt.10)then
	  write(chn1,'(i1)')nz
	  chn1 = '0000'//chn1
      elseif(nz.lt.100)then
	  write(chn1,'(i2)')nz
	  chn1 = '000'//chn1
      elseif(nz.lt.1000)then
	  write(chn1,'(i3)')nz
	  chn1 = '00'//chn1
      elseif(nz.lt.10000)then
	  write(chn1,'(i4)')nz
	  chn1 = '0'//chn1
      elseif(nz.lt.100000)then
	  write(chn1,'(i5)')nz
      endif


      if(nx.lt.10)then
	  write(chn2,'(i1)')nx
	  chn2 = '0000'//chn2
      elseif(nx.lt.100)then
	  write(chn2,'(i2)')nx
	  chn2 = '000'//chn2 
      elseif(nx.lt.1000)then
	  write(chn2,'(i3)')nx
	  chn2 = '00'//chn2 
      elseif(nx.lt.10000)then
	  write(chn2,'(i4)')nx
	  chn2 = '0'//chn2
      elseif(nx.lt.100000)then
	  write(chn2,'(i5)')nx
      endif

      if(ntsnaps.lt.10)then
	  write(chn3,'(i1)')ntsnaps
	  chn3 = '0000'//chn3
      elseif(ntsnaps.lt.100)then
	  write(chn3,'(i2)')ntsnaps
	  chn3 = '000'//chn3 
      elseif(ntsnaps.lt.1000)then
	  write(chn3,'(i3)')ntsnaps
	  chn3 = '00'//chn3
      elseif(ntsnaps.lt.10000)then
	  write(chn3,'(i4)')ntsnaps
	  chn3 = '0'//chn3
      elseif(ntsnaps.lt.100000)then
	  write(chn3,'(i5)')ntsnaps

      endif

 


      write(chdelta,'(E10.4)')delta
      write(chd3,'(E10.4)')dtsnaps
      write(chd1num,'(E10.4)')d1num
      write(chd2num,'(E10.4)')d2num
      write(chwbox,'(E10.4)')wbox
      hbox = (nz*wbox)/float(nx)
      write(chhbox,'(E10.4)')hbox
      write(chf1,'(E10.4)')f1
      write(chf2,'(E10.4)')f2
      write(chf3,'(E10.4)')ft





	    write(*,*)'psmovie <'//filename1//'.bin'//' n1='//chn1//' d1='//chdelta//' n2='//chn2//' d2='//chdelta//&
		& ' n3='//chn3//' d3='//chd3//' f1='//chf1//' f2='//chf2//' f3='//chf3//&
		& ' f1num=0.00'//' f2num=0.00'//&
		& ' title='//apos//title//apos//&
		& ' title2='//apos//'t'//apos//&
		& ' label1='//apos//label1//apos//&
		& ' label2='//apos//label2//apos//&
		& ' wbox='//chwbox//' hbox='//chhbox//' d1num='//chd1num//' d2num='//chd2num//&
		& ' labelsize=12 titlesize=18 >'//filename1//'.ps   &'

	    call system('psmovie <'//filename1//'.bin'//' n1='//chn1//' d1='//chdelta//' n2='//chn2//' d2='//chdelta//&
		& ' n3='//chn3//' d3='//chd3//' f1='//chf1//' f2='//chf2//' f3='//chf3//&
		& ' f1num=0.00'//' f2num=0.00'//&
		& ' title='//apos//title//apos//&
		& ' title2='//apos//'t'//apos//&
		& ' label1='//apos//label1//apos//&
		& ' label2='//apos//label2//apos//&
		& ' wbox='//chwbox//' hbox='//chhbox//' d1num='//chd1num//' d2num='//chd2num//&
		& ' labelsize=12 titlesize=18 verbose=0 >'//filename1//'.ps   &')




      return

!  151  format(//a390//)
      end